from matplotlib import pyplot as plt
import numpy as np

# combine
x=np.arange(1,20,2)
y_bar=[3,4,6,8,9,10,9,11,7,8]
y_line=[2,3,5,7,8,9,8,10,6,7]
plt.bar(x,y_bar)
plt.plot(x,y_line,'-o',color='y')
plt.show()
# group 1
x=np.linspace(0,10,20)
y=x**2+2
fig=plt.figure()
axes1=fig.add_axes([0.1,0.1,0.8,0.8])
axes2=fig.add_axes([0.2,0.5,0.4,0.3])
axes1.plot(x,y,'r')
axes2.plot(y,x,'g')
plt.show()
# group 2
fig,axes=plt.subplots(figsize=(16,9),dpi=50,nrows=1,ncols=2)
for ax in axes:
    ax.plot(x,y,'r')
plt.show()
